//
//  Mas.m
//  Frases D Futbol
//
//  Created by Jose Luis Lopez on 24/06/11.
//  Copyright 2011 None. All rights reserved.
//

#import "Mas.h"
#import "Frases_D_FutbolViewController.h"


@implementation Mas

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    
    self.screenName = @"Mas Screen";
    
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    
    //  Aquí añadimos la barra superior
//    UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
//    navBar.barStyle = UIBarStyleBlackOpaque;
//    navBar.tintColor = [UIColor whiteColor];
//    [self.view addSubview:navBar];
    
    self.title = @"Más";
    
    

    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
    
    NSString *version = [[UIDevice currentDevice] systemVersion];
    int ver = [version intValue];
    if (ver < 7){
        //iOS 6 work
    }
    else{
        //iOS 7 related work
        self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    }
    
    [self.view setBackgroundColor:[UIColor whiteColor]];

    
    UIButton *masButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
    [masButton addTarget:self action:@selector(fdf:) forControlEvents:UIControlEventTouchUpInside];
    [masButton setFrame:CGRectMake(320 - 25, 10, 25, 25)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:masButton];
//    [navBar addSubview:masButton];
    
    //  Aquí agregamos la label a dicha barra
    UILabel *labelBar = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    labelBar.font = [UIFont fontWithName:@"Helvetica-Bold" size:18];
    labelBar.text = @"Más";
    labelBar.backgroundColor = [UIColor clearColor];
    labelBar.textColor = [UIColor whiteColor];
    labelBar.textAlignment = UITextAlignmentCenter;
    [self.view addSubview:labelBar];
    
    //  Añadimos la imagen y la label
    UIImageView *imagenV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 44, 320, 320)];
    imagenV.image = [UIImage imageNamed:@"letrero.png"];
    [self.view addSubview:imagenV];
    
    UITextView *copyRight = [[UITextView alloc] initWithFrame:CGRectMake(20, 340, 280, 150)];
    [copyRight setText:@"Esta app ha sido desarrollada por\n Maniac Developers.\nTodos los derechos reservados 2014©"];
    [copyRight setTextAlignment:NSTextAlignmentCenter];
    [copyRight setUserInteractionEnabled:NO];
    [self.view addSubview:copyRight];
//    
//    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 340, 320, 22)];
//    label.font = [UIFont fontWithName:@"Helvetica" size:12];
//    label.text = @"Desarrollado por Maniac Developers";
//    label.backgroundColor = [UIColor clearColor];
//    label.textColor = [UIColor blackColor];
//    label.textAlignment = UITextAlignmentCenter;
//    [self.view addSubview:label];
//    
//    UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 362, 320, 22)];
//    label2.font = [UIFont fontWithName:@"Helvetica" size:12];
//    label2.text = @"todos los derechos reservados ©";
//    label2.backgroundColor = [UIColor clearColor];
//    label2.textColor = [UIColor blackColor];
//    label2.textAlignment = UITextAlignmentCenter;
//    [self.view addSubview:label2];
//    

    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void)fdf:(id)sender
{
//    Frases_D_FutbolViewController * controller = [[Frases_D_FutbolViewController alloc] initWithNibName:nil bundle:nil];
//    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//    [self presentModalViewController:controller animated:YES];
//    [controller release];
    [self dismissModalViewControllerAnimated:YES];
    
}

@end
